﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PDO.DataPersistence.Core
{
    // See the attribute guidelines at http://go.microsoft.com/fwlink/?LinkId=85236        

    /// <summary>
    /// Attribute used to decorate PersistableDataObject derived classes providing type inheritance information.
    /// This atribute appears on PDO classes serving as a base class for other PDO classes.
    /// </summary>
    [global::System.AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
    public sealed class TypeExtensionAttribute : Attribute
    {
        private string _extendedClassNameProperty;
        private string _baseItemPKeyProperty;

        public string BaseItemPKeyProperty
        {
            get { return _baseItemPKeyProperty; }
            set { _baseItemPKeyProperty = value; }
        }

        public string ExtendedClassNameProperty
        {
            get { return _extendedClassNameProperty; }
            private set { _extendedClassNameProperty = value; }
        }

        private TypeExtensionAttribute()
        {
        }

        public TypeExtensionAttribute(string extendedClassNameProperty, string baseItemPKey)
            : this()
        {
            ExtendedClassNameProperty = extendedClassNameProperty;
            BaseItemPKeyProperty = baseItemPKey;
        }
    }
}
